<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('name');
			$table->boolean('sex')->nullable()->default(0)->comment('0女1男');
			$table->integer('age')->nullable()->comment('年龄');
			$table->char('telphone', 11)->unique('telphone');
			$table->string('id_card', 18)->unique('id_card');
			$table->string('img_url')->nullable()->comment('用户头像');
			$table->timestamps();
			$table->string('openid');
			$table->integer('status')->nullable()->default(1)->comment('1激活用户,0停用用户');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}

}
